#pragma once
#ifndef adaptors_h
#define adaptors_h
#include <list>
#include "bass.h"
#include "pl_consts.h"
#define ENGINE_ATTRIB_VOL_CHAN BASS_ATTRIB_MUSIC_VOL_CHAN
#define ENGINE_ATTRIB_VOL BASS_ATTRIB_VOL
#define ENGINE_POS_BYTE BASS_POS_BYTE

#define ENGINE_FFT512 BASS_DATA_FFT512
#define ENGINE_FFT1024 BASS_DATA_FFT1024
#define ENGINE_FFT2048 BASS_DATA_FFT2048

    //class ENGINE
//    std::list <plugin_rec> pluglst;
    bool engine_init();
    void engine_free();
    void engine_load_plugin(char *fname);
    void engine_load_all_plugins();
    void engine_set_attribute(HSTREAM hndl, DWORD params, float value);
    void engine_set_volume(HSTREAM hndl, float volume);
    void engine_equalizer_init(HSTREAM hndl, HFX &fx);
    void engine_channel_getdata(HSTREAM hndl,void *target, DWORD len);
    void engine_channel_pause(HSTREAM hndl);
    void engine_channel_play(HSTREAM hndl, bool replay);
    QWORD engine_channel_getposition(HSTREAM hndl, DWORD mode);
    void engine_channel_setposition(HSTREAM hndl, QWORD pos, QWORD mode);
    void engine_equalizer_setfreq(HFX &fx, WORD freq, int val);
    void engine_channel_terminate(HSTREAM hndl);
    void engine_free_allplugins();

    HSTREAM engine_channel_create(char *fname, bool faked);
    float engine_channel_getlength(HSTREAM hndl);
    double engine_channel_bytes2seconds(HSTREAM hndl, QWORD pos);
    QWORD engine_channel_seconds2bytes(HSTREAM hndl, double pos);
    float engine_get_volume(HSTREAM hndl);
    float engine_get_cpu();
    float engine_get_attribute(HSTREAM hndl, DWORD params);

#endif
